package com.lbd.system.service.impl;

import com.lbd.system.bean.UserAuthentication;
import com.lbd.system.dao.UserAuthenticationRepository;
import com.lbd.system.service.UserAuthenticationService;
import com.lbd.base.service.BaseServiceImpl;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;


@Service
@Transactional
public class UserAuthenticationServiceImpl extends BaseServiceImpl<UserAuthentication, UserAuthenticationRepository> implements UserAuthenticationService {
    private final Logger log = Logger.getLogger(this.getClass());
    @Autowired
    UserAuthenticationRepository userauthenticationRepository;

    @Override
    public Specification<UserAuthentication> getSpecification(UserAuthentication userauthentication) {
        return null;
    }

    /**
     * 构建查询语句和参数
     *
     * @param userauthentication
     * @param parameter
     * @return
     */
    @Override
    public String buildJpql(UserAuthentication userauthentication, Map<String, Object> parameter) {
        StringBuilder jpqlBuilder = new StringBuilder("  from  UserAuthentication t   ");
        if (userauthentication != null) {

        }
        jpqlBuilder.append(" order by createdDate desc ");
        return jpqlBuilder.toString();
    }


}
